Clean up code by extracting methods from extensive code portions.
Authored by: jwjoubert 2014-01-24
Parent: [r27615]
Child: [r27617]