Refactored to use the generator layout.