Cleaned up and refactured AuthBehavior.php