JS traslate refactor