various changes after code review