simplified the types

simplified the types
generic function working

generic function working