Improved the overall structure of the program.