refactorized angular code with head.js and require js