code review comments, bug fixes and tests