convert to use require.js