ListHead: factorize some iterator code