adapt more behaviours into angularjs framework