Deduplicate PeriodicTask and TriggeredTask using C++1y
Symplify code