- updated for readability
- various cleanup