Memory waste and code cleaning