Better Way to Deduce Object Type ?

Correct Sir! I didn’t thought about it.