Some code optimizations...