Move some function calls to main()
Move some function calls to main()