move code from sampleApp to translation_tool