abstract generate method