A lot cleaner code to update entries.