Refactoring Controller to limit scope of returns