extract function for uri parsing