remove unnecessary function and added comments
query for database tables that exist