LP 1198465: Refactor logic into gatekeeper functions