refactor uniquifying string array