Refactor authentication classes