Some Code optimizations