Added TileFactory class definition