refactor VM.