refactor js editor