merge two class into one