Refactoring the controller and fixing a possible server lock bug