refactor jsutil