improve code of insert_share_likes---delete duplicated code