(cleanup) cleaned modify-tree factory, railroad directive, and main controller