Add functionality to rebuild indexes