refactoring controller tests