rewrites controller to be more testable