more tweaks and improvements to improve build speed and reliability