Refactoring the tests to make them less obscure
Removed duplication from sending the queries.