Refactoring of router provider