refactor define.js