Changing to domain-database interaction