moved client_socket into separate file, refactoring