why is this check needed? just so that we do not return an empty string but instead null? that being said .. maybe better to assign to a variable rather than calling the method twice.