minor fixes and code review