mandelbrot refactor