Refactor get_machine_status