Core: router refactoring