Code optimization on angularjs with require.