Slight re-organization of code.