refactor social auth