Refactor to use where clause
Fix stuff
Refactor specs
Formatting
Support for bind vars