task loding refactoring