Fine tuned private database function