ensuring hasNext can be called several times + reorganizing a bit cases to try to match faster