Refactor the urlFilter