refactor with requires
refactor config and visualizer