refactor

Signed-off-by: Oliver Pinter <op@freebsd.org>
added segvugard test

Signed-off-by: Oliver Pinter <op@freebsd.org>