Passing element to constructor is optional; move this logic to
attachTo method.