lift things out of main, clean them up.