shoring up unit tests, splitting up some functionality.