Refactoring loadNpmTasks