Architectural refactory to make application more compliant to AngularJs best practices