Cleaned up rpc.js