Refactor filters and routes