require.js refactor