decorator with factory design pattern