This whole method is still too long. I think it'd be great if we could make it shorter by extracting methods e.g. for every sub tree of an if statement, the initialization etc.