Clean up tiling code