new color pattern and major refactoring