Changed location and interval triggers to be part of the script because it would make it easier to manage.