Refactored code; more consist with G4 style.

Signed-off-by: JP-Ellis <coujellis@gmail.com>