Some progress bar refactoring.