more tweaks and refinement