moving normalization logic into separate module