refactoring requirejs