Some refactoring in Scatter.