refactor and only pre-fill IP if its unique (thanks to Peter for the suggestion)