New API for main()