Add support for nested stages