Add js2 refactor