move the introspection functions out of generator