progressbar refactored (mirror to 56979f4a0fa81304e74076158246d883882c5d81)