Integration of ecosystem engineering and trophic effects of herbivores