unit test revealed a flaw in design