Enhancing the dropdown to be generic and allow for any number of sub nested elements