improve memory management p.2