Refactor StringUtil