greatly simplified type coercing code