Reorganize/Reformat main class