migrate to require.js