SSO app refactoring