Yeah, it was quite painful debugging the previous state of the progress bar logic since it was very cryptic in the code :)

I will add comments in the code for `getProgressBarState`.