- first round of changes based on code review comments
- some code improvements based on code review