Refactor format behavior.