minor restructure for tests