a few more small optimizations