[vault] Be slightly more efficient and call less times the same functions

Reduce a bit of overhead.