refactored taskRunner