Refactor before filter for admin authentication