make db more generic