why do you need to pass the type too? you can ask the obj for its type, maybe can move into a helper