better type determination