Refactoring + client handler