Add better color handling and refactoring.