Refactored project using angularjs