refactored progress bar stuff