Refactoring Programs system plugin and adding re-index function when adding new location.