db manager - first part