removed some unused code and add rpc command