Refactor some code in the event authentication path for clarity.