Improving generator test