Add support for environment hooks