more code migrated to angularjs