Pulling out functions before mosaic