Modularization of the code, code cleanup, exception handling added. In general increase in code quality.