more refactor and visualizations