Optimize
Remove legacy code from maxdepth era