refactored in angular style
reformat