Restructure Analysis code.