one example of refactored controller added to tests