vhsm full refactoring