Clean up non-relative exit url reference (and misc code cleaning)