Only instance the main class if proper conditions are met. Make the auth code more cryptographically secure.