Refactor formatting