converted to adapter pattern