Refactored to use elements