Upadate url and clean up code