Refactor normalization

As discussed in #2131 this is adding more tests. The previous PR actually didn't solve the main issue with #2025.