initial routing refactoring, relates #9