This should be a generic `renderTile` function