refactored the long method by creating a helper class that uses fields instead of many many many temporary variables. the fields made it much easier to create smaller methods without passing in a lot of parameters.