Reduced code duplication in Controller class.