refactor url decoding