outsourcing handle_client