The method is 99 lines long, we should consider splitting it into simpler chunks