Improved code quality of generateElements a bit

The if statement defining trigger is much easier to understand and not
so negative.

It is also better prepared for new activation types being introduced.