minor adjustment, just some comments and rearranging
Use available Referrer, if suitable