Better generation here and cleanup