WIP client socket handler refactor