is the cast needed here and on line 254? Seems like a double cast. I'd rather it only here, and on line 254. we still have the correct types.