It might be cleaner to move this above the USE_COMPILED_ROUTER block.  Then the merge would be unnecessary etc.