a few more optimizations