Changed generate structure