Refactored javascript to remove RootItemsView