ref: unified RPC events
ref: cleaner code, removed duplication