refactor coloring