Refactored out BaseController