minor efficiency tweaks