Refactoring server and cleaning controllers