Major refactor to abstract the underlying TMX representation