move showProgress function to factory