make changes to improve vm editing behavior and remove unnecessary code