working on generic types casting