Refactor Shell Coloring Code