generator test and reduce iteration length