Reorganized program into class