refactor, now supported more than 3 level sub-menu