refactor color coding