Introduce tokenFactory and proxyFactory (with tests)