Fix bug where entity argument overrides last component in every hook when an event is present plus style cleanup