more work to port toward angularjs