- Logging is added.
- Some more code cleanup is done.wq