Refactor color method.