refactor to angular