is it possible to reformat this piece of code in Kotlin, that it gets a bit smaller? The function should return A and B as a Pair, if both are unequal to null. Else it should re