Improve code reuse in the application main router