refactor MemDico.