small refactorings, added refresh OAUTH2 token