Improve resume implementation in main()