1) discusion: what is idx?
2) put this logic in a new class: .resource.ResourceDebugControllers.registerControllers()