Refactored with angular