Cleans up database