Refactor machineconsole