Moved tiling functionality into separate module