Moved script actions into separate functions instead of defining them in Ember event hooks