refactored formatting of values