Correctly remove database and more cleanup+coding style.
Correctly handling messages of check for update.