refactoring/cleanup, especially color rule
Pointing out untested logic with a TODO