refactor a bit and prepare to hybrid scd with icf