I've extracted this as a separate method instead.