maybe rename throwNullException to throwMalformedException ?