Refactoring.

Simplify URL generating.