scattergram refactoring