minimal memory optimization tweaks