refactor renewing an authentication token and renew on use