Major refactoring

region monitoring still doesn’t work