rebuilt using AngularJS