Bugfix
* fix incorrect logic in unregisterRpcMethodWorker function

Improving
* improve code by removing some double code