refactor of controllers to make them much smaller