Refactor de Memoria, agrego comentarios, saco cordigo repetido