removed Proc::Background
split db routines to their own file