An exercise in refactoring controller actions