Do this earlier in the process