complete refactoring of the color management