try to reconstruct the UI logic use angular.js