Issue 516: code review changes