wip

work in progress for bug 1071380.