refactoring and additional tracing to Tmx.Client