cleanup and make foo an arg