Well I did borrow the idea of checking the FORWARDED variable from the find_by_ip code, yes. Do you want that extracted into a separate method?