Few tweaks and optimizations