simplified interface and made test code work