Refactored code to create a BaseVisualization class which can be inherited by all the different visualization types with standard implementation type.