Refactor colorize method