Is this piece of code the same than in line #514 ? Could we refactor and extract to a method?