Beginning of changes to move to angularjs