Refactored to use OAuth2 and cleaned up settings.