independency from COC-ABM and some small modifications