wrapped legacy code in tests