refactor code and add apache common lang to pom.xml for use ArrayUtils to merge array