Several optimizations