factorize vf length
fix variable test
Merge pull request #495 from arnaudbey/refacto

Refacto