Fix database queries to be more streamlined
Remove all unnecessary console logging