fix translate, clean code