More work on db integration