DRY `generate.rs`