reduce memory usage for tasks

More commented-out code carried over from groovy version.