Add command implementation for index
Refactor Publisher
Add test cases for index