Tests based on kaleidoscope. Refactor kaleidoscope.