Delete excess code, change machi check logic