Refactoring of formatter module