generalized conversions and more cleanup