Merge "Refactor and improve GC root handling"