Tweaks to reduce memory usage and improve overall performance.