Also separate out some of the utility functions. Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>