code to translate models