[ref] Split code in 2 methods