refactored task