Removed logging
Moved connection creation to a separate method
Implemented query events