Refactored Auth module