refactored when_every container code
fixed clang error