updated API, now able to accept a TypeStore