refactor controller tests