Before factoring js
Restructure AngularJs