Refactor normalization
Merge pull request #2152 from darthdeus/fix-normalization

Refactor normalization