This method is very large to begin with, please break this out into it's own method