partial cleanup of state