code cleanup and moving device creation outside of createVM method.  Also cleaned up some variable names