Refactor the ring handler.