Refactor the way that attributes are merged together.