Memory optimizations to reduce CPU costs