encapsulate in main()