Continued to refactor codes using Angular.js