implement nested category trees feature