Changed to make factories take an element as an arguement when
constructing new objects.