Reorganized log location, broke down main()