Refactor result class to use configurable formatter