optimization and refactoring VADTest