Outlining analysis code to separate procedure.