refactored commands for rebuilding indices
refactored commands for rebuilding indices