refactoring routing and filter management