[vault] Be slightly more efficient and call less times the same functions
Merge pull request #7 from giucam/perf

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