Restructure progress bar handling.