added template methods for database interaction