Reduced the code required for setting the accept headers on the fly