Event chain, simplified some plugin and event logic, rebased some code