Optimizations here and there