refactor to controllers inside classes