URI refactor and clean optimization