Refactored authorization checks