convert $root from class static to method static

This avoids accidental direct access from other class methods.