improve auto generation