some serial optimizations