Some refactoring and colorize warning messages