Eliminate duplication and use string instead of array