improve Uri implementation