Some enhancements & optimizations