refactor vms