refactored to remove checks for single elems