Small refactoring of the original formatter