Refactor update logic
Finish refactor on js updates