task class refactor