refactor downloading latest dist