Refactoring in headerStringFormat method

Removed redundant string text, assigning with the switch-case block only
the contentType value.