Further broke out clickNode into helper functions to separate
UI logic from tree validation logic.