little optimizations motivated by profiling...