Cleaning up query interface
worked on moving helpers to util. Added system tests