refactored formatiing