refactor url generate