move isAckDataValid to its own function