the code is not ready atm, i'm just suggesting to move this part  of the code as it is now into a separate sub. it will help the later move to CAF::Service.