added and refactored for require.js and cs.js