Some generalization and cleanup
Removed uri_path/2
Cleanup