refactor formatter