Extract clientside rpc controller, and further improve logging