Refactoring ProgressBar