NXP-16212: cleaning and refactoring indexing command