basic cleanup of source mode