fixed issue with unregister not unregistering from roundrobin and refactored to use common code