Speeding up generate