refactor coloring method to allow user override