moved database functions to contactdao