# [Green line] ICON4Py cleanup
Algorithms throughout the icon4py code need to be homogenized as patterns are repeated and at times replicated in a not so elegant way.
## Homogenize chain behavior - PR merged
- `MultiLocation.to_dim_list` has a more appropriate behavior compared to the algorihtm implemented in metadata file line 193 and below [location_chain](https://github.com/C2SM/icon4py/pull/489/files#diff-badc837232d9948eb7ee8edd83f79065fbd6dfcc89e6e695cca3fc53664cccd9R193)
- `calc_num_neighbors` does the same thing as line 210 return statement in metadata file [here](https://github.com/C2SM/icon4py/pull/489/files#diff-badc837232d9948eb7ee8edd83f79065fbd6dfcc89e6e695cca3fc53664cccd9R210)
```
max_neighbors=IcoChainSize.get(location_chain) + include_center
```
- Check in the code where these algorithms are used and make sure their behavior is homogenized
## Complete KHalfDim impl. for diffusion - PR opened
```
KHalfDim = Dimension("KHalf", kind=DimensionKind.VERTICAL)
````
Mark all stencils with field with KHalfDim (potentially figure it out from FORTRAN)
Start by doing this only for diffusion stencils as there are not so many fields with KHalfDIm --> this might break the CI
## Update Type Aliases - PR merged
Newly merged does not have the correct Fields TypeAlias as per https://github.com/C2SM/icon4py/pull/473
## Additional cleanups
Some cleanups from previous cycles were not completed. Check list from this [doc](https://hackmd.io/dhnmQmwSTdSpyqDoCRwdgw?both)
# Add r2b4 with pytest.parametrize to metrics_fields tests - PR merged