extract js refactoring into plugin