Updated the Trigger class to use Template Method design pattern.