refactor sharemem + ajout commentaires