Minor code optimizations