seperate rpc socket client code from controllers