Improve generating class