Refactor with angular