Replace 'tiles.bufferCount' with function