move code back to vm