a few speedups