Disentangle it, having separate helper methods, each with clear responsibilities. Also each helper method has a manageable size, making the whole thing more maintainable.
Nothing changed in terms of functionality or behavior.. Fixes: . Approved by Jay Taoko.