clean up check code