refactor to adapt to comodl changes