Refactor end action scheduling