Improve url encode type safety