Refactored code. Colored output