- refactor some loops to use LINQ
- store more UI settings persistently.