Re-organise class and make it generic
merge