stuff for database persistence