Changed TreeView to save only modified courses, improved performance and refactored its code