encapsulate query arguments, closes #368