refactoring: extracted common code from CheckboxTree and CheckboxTreeTable (better late than never)