New cleanup

Replacement for #146.