[translate] some code refactoring