more flexible setting of root to support unit testing