Refactored coloring of output text