Refactorings and started implementing prefix for rpc