Issue 517: code review changes