#44 moving query methods to their own lib file