Complete the refactor and re-do tests.