Refactor social auth module