optimize the structure of ts-edit.js