bug 1316: code cleanup