Moving JS actions to seperate file