Would it be possible to split this method a little? At this point its a bit of a large method