Move generate method into base class.