cleaning up the mosaic logic slightly