HH-29111 cleanup, refactoring, more routing logic