factor out Tiles as a module