share-social: refactor some code