Refactor service unregister, move it to the router