Improved code logic. Less redundancies.