mandelbrot: clean up and optimize a bit