add some tests and cleanup following "Added Optimize to index actions"