closer to enter/exit and tree control and less code duplication