cleanup c stubs, and simple interface