refactor code to wizsheet.js