Progress bar refactor plus protections.