Refactored Formatter class