Refactoring of the formatting system