factory: move global_env.stdin_queue inicialazing into state module