A couple of optimizations