factor out conversions