Refactor instantiate using TypeValue

Please resolve this `// TODO` or open an issue.