looks too complicated for me. can we simplify it? Why do we need tread primitive separately? Is string primitive type?