adjusted the string constructors to reuse the common code