Refactoring to include requireJS.