DRY up request and path filtering

No changes to the logic, just dry'ing up the code