Simplified more code in generate methods