started refactoring with requirejs