Controller refactor