refactoring with requirejs