refactoring to allow easier change of ColorDetector implementation