add generateFromString() method + fix 2 issues with ArgumentError usage