Refactors database connection methods - try to simply pass a query and pass result to callback