Refactor the code a little in ProgressFragment

-Make some of the variables local and put them in appropriate methods.