Continuing to refactor code to add generality.