Extract out helper methods of RPCHandler as pure functions.