refactor format