working on improved auto-generation