Restructure main.swift to make it easier to distinguish differences between NSThread case and non-NSThread case