rid of global, use datastore queries