move update to it's own method, called from save()