Methods this size are typically a code smell, would it be possible to break this down into methods that encapsulate different parts of the process?