Some environment monitor refactoring