refactoring and decoupling in Tmx