Cleaning up code (in the general settings the database needs to be opened only when the user wants to wipe database)