           if (unquote(verbose)) do
             @base.banner("TERMINATE #{__MODULE__} (#{inspect state.worker_ref}\n Reason: #{inspect reason}") |> Logger.info()
           end
-          state = clear_inactivity_check(state)
-          @worker_state_entity.terminate_hook(reason, state)
+          @worker_state_entity.terminate_hook(reason, clear_inactivity_check(state))
         end
       end # end start_link
 

            schedule_migrate_shutdown(context, state)
          else
            spawn fn() ->
                :thread.sleep(500)
                @server.worker_terminate!(ref, nil, context)
              end
            state

                  @server.worker_terminate!(ref, nil, context)
                  {:noreply, state}
                {:wait, state} ->
                  {:noreply, schedule_migrate_shutdown(context, state)}
              end
            else
              @server.worker_terminate!(ref, nil, context)
              {:noreply, state}
            end
          else
            {:noreply, state}
          end
        end # end handle_info/:activity_check

        def handle_info({:i, {:migrate_shutdown, ref}, context}, %Noizu.SimplePool.Worker.State{migrating: false} = state) do
