Split template selection and external tool management into dedicated modules for better separation of concerns.