Refactoring of third party login