Auto build categories tree.