Refactor formatting tests.