Refactoring VM. Typescript update.