Re-arrange and clean-up

Signed-off-by: Tim Smart <tim@fostle.com>