refactoring, trying to make the rpc methods code simple to marco-out