Cleanup
Cache sample indexes to file
Refactoring command-line actions