tweaked the db namespace and added queries to core