Refactor access token validation logic