Added code to remove unused indexes