More DB functions and views.