move RPC 'call' to a saperate file