refactoring and fixed bug for requirejs and rename