Add some minor optimizations