I think this is a monster method and should be broken up with some SRP analysis.