added callback and adapter pattern