Moved generate methods into separate file