Basic restructuring of the code.