Big refactoring of color code.