rework angular logic