better database interaction