Slight refactor to pjax check and notes to self.
Moved the function I for some reason moved (???) back to where it belongs.