refactor progress printing