Week 2 task refactor