refactor Typefactory to use as... methods