cleanup and comments in Machine