refactored controller tests