refactoring advault