add a little hook to the toStructure to extract paths and else