Factor out common assert code + update comment