refactored to add an elements collection