controller tests

couple of refactorings