Updated to use database.