implementation of adapter pattern