refining the tile entity code