A few simple optimizations