Updated generate controller