Add helper functions; db-relation hooks