Refactor update