Use transform_element and add typespecs