a few possible optimizations