more small optimizations