added factory for interacting with trees