add indices.optimize function
ad indices.refresh function