refactoring to support multi query values, i.e. x=1&x=2