Refactor formatters code