Added database helper functions