More code simplifications and cleanup. Trying to make this code more DRY and concise.

Signed-off-by: Daniel (dmilith) Dettlaff <dmilith@verknowsys.com>