refactor ClientController
factor serverController out