break mosaic logic to separate class