A separate method for this pice of code would be nice, for easier understanding of what it does.