refactored methods to vm