simplify generate_from_string