[core] gc engine: move plugins code