refactored for ngView