Trying to make this thing unit-testable
blah.... no sleep...nothing is making sense