Issue refs #1691: clean code, refactoring, add oauth data deletion after login