use plain element instead of un-wrapping the element again

instead of wrapping and unwrapping the element over and over again, we use the parameter initially passed to the function