preparing for initial import: more generic cleanup of input