Move exclude urls logic directly in the callback