added optimizer method to turn every node into an rpc call