This method is too long. I think it will clean up a lot if you pull out the content of the for loop.