Updated the poc with callback function, to use as plugin