Just reorganized code a little bit. No functional changes.

Signed-off-by: William Raiford <bill.mybiz@gmail.com>