Extended max URI length, and did some refactoring.