Added helper functions to database struct