Changes in DB module: new function, better split between files