move rpc related structures to package rpc. fixing #5