better code structure for treeview and redirect according to urlLocale