Move unrelated code in flip tiles.