added a to_type overload