Refactoring cooler for use as a module.