better logging and url parsing