Restructured main class.
Restructured main class.