Colormodel is updated when representative state has weight bigger than threshold + code cleanup