refactoring and tracing to Tmx.Server and Tmx.Client