Added option to switch between flat and hierarchical interface