Refactoring query parameters