refactor modify.js