refactor for validation and views -- the angular way