Removed inferred return types.
Added type to case to make it less ambiguous.
Changed the progress bar updating to a more functional style.