Sort of solution proposal for Casting Exception handling