Organize `update` function more