Refactor of Trigger.cs and comments added