Refactor to remove cruft.