> I put here for avoiding to make this checking everytime we call updateHeaderData. On the other hand I would like to isolate updateHeaderData to window.location in this case.

exactly: I'd say we _want_ to do this check everytime we call updatHeaderData, because the check is cheap, whereas updateHeaderData does a lot of stuff.