Code cleanup and reorganizing for better reading of code.
Authored by: SumolX 2007-02-21
Parent: [r518]
Child: [r520]