Reorganize and refactor.