Refactored uri prefix into a function.