refactoring progressBar