Few tweaks and optimization