refactoring require js