move echo to generate method