Refactor out allowed requests code