refactoring to Tmx.Client and Tmx.Server