Minor cleaning and org of code.