Reformat and refactor.