Refactor formatters and the formatter behavior