Changes to use of database