first (naive) cut at identifier remapping and join injection