Refactor of color code.