small speedups based off of profiler.