Refactor to fix incompatibility with charm (and therefore multimeter).