√ refactor the now long and linear implementation.
√ rewrite % as format() calls
√ add a check for application/xml as the content type