first step towards removing duplicate code from the sanity check