Recursive tree for Programs, Session factory