Move guess_type into the utils module