Being Excellent : Refactored authentication code