Fix and Clean-up the RPC class