some more value formatting refactoring