Refactor instantiate using TypeValue