Small code optimizations
Minor changes