refactor complete

LGTM on second machine

Signed-off-by: AndrewPalmer <a.d.palmer@gmail.com>