refactored to incorporate task repository class and methods