Adapt code to support generic interface