refactor js update