I just extracted what Adam had before into a variable so I could use it later, but I'll add some null checks in