test controller refactoring