tasks loading refactoring