Clean login and progressbar code up