clean up of main()