Organized the code with require.js