better index database cleanup