refactored loadTask