Improve coloring code.