added generic key object and some logging