Add where query
Extracted configuration and spec helper out of main module