minor efficiency improvements