some more small tweaks

Signed-off-by: Chris Jones <chris@jonezy.org>
bit of reorg and refactoring.

Signed-off-by: Chris Jones <chris@jonezy.org>