utils for db work