Refactor samples update mechanism.