refactor; requirejs