refactor routing mechanizm