orphanage and database stuff