using flatten to speed up build/publish