Refactor socialauth library