progress: refactor logic and template